<!--

/* - - - - - - - - - - - - - - - - - - Macromedia Functions - - - - - - - - - - - - - - - - - - */
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_jumpMenu(targ,selObj,restore){ //v3.0
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
	
	//06122006 / SRC / created to decrease QuickShop page size and improve performance
	function MM_openBrWindowQuickShop(theProductID, theMenuID) { 
	  window.open('showitem.asp?ProductId=' + theProductID + '&menuId=' + theMenuID + '&template=popupDetail&menuId=&withLinks=0','detail','scrollbars=yes,width=550,height=400');
	}
	
	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];}}
	}
	
	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);
	
	function MM_showHideLayers() { //v6.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
		obj.visibility=v; }
	}
	
	function MM_initTimelines() { //v4.0
		//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
		var ns = navigator.appName == "Netscape";
		var ns4 = (ns && parseInt(navigator.appVersion) == 4);
		var ns5 = (ns && parseInt(navigator.appVersion) > 4);
		var macIE5 = (navigator.platform ? (navigator.platform == "MacPPC") : false) && (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4);
		document.MM_Time = new Array(1);
		document.MM_Time[0] = new Array(0);
		document.MM_Time["Timeline2"] = document.MM_Time[0];
		document.MM_Time[0].MM_Name = "Timeline2";
		document.MM_Time[0].fps = 15;
		document.MM_Time[0].lastFrame = 0;
		for (i=0; i<document.MM_Time.length; i++) {
			document.MM_Time[i].ID = null;
			document.MM_Time[i].curFrame = 0;
			document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
		}
	}
	
	function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
		  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
		  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
		  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
		  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
			if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
				if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
				if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
				if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
			features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
		  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
		  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
		  var wp = popupWindow.length;
		  popupWindow[wp] = window.open(theURL,winName,features);
		  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
		  if (document.all || document.layers || document.getElementById) {
			if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
			if (alwaysOnTop && alwaysOnTop != "") {
				ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
				popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
			if (autoCloseTime && autoCloseTime > 0) {
				popupWindow[wp].document.body.onbeforeunload = function() {
					if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
					window.onbeforeunload = null;	}  
				autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
			window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
		  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
		}
	
	function YY_checkform() { //v4.71
	//copyright (c)1998,2002 Yaromat.com
	  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
	  for (i=1; i<a.length;i=i+4){
		if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
		o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
		o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
		v=o.value;t=a[i+2];
		if (o.type=='text'||o.type=='password'||o.type=='hidden'){
		  if (r&&v.length==0){err=true}
		  if (v.length>0)
		  if (t==1){ //fromto
			ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
		  } else if (t==2){
			rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
		  } else if (t==3){ // date
			ma=a[i+1].split("#");at=v.match(ma[0]);
			if(at){
			  cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
			  dte=new Date(cy,cm,cd);
			  if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
			}else{err=true}
		  } else if (t==4){ // time
			ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
		  } else if (t==5){ // check this 2
				if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
				if(!o1.checked){err=true}
		  } else if (t==6){ // the same
				if(v!=MM_findObj(a[i+1]).value){err=true}
		  }
		} else
		if (!o.type&&o.length>0&&o[0].type=='radio'){
			  at = a[i].match(/(.*)\[(\d+)\].*/i);
			  o2=(o.length>1)?o[at[2]]:o;
		  if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
		  if (t==2){
			oo=false;
			for(j=0;j<o.length;j++){oo=oo||o[j].checked}
			if(!oo){s+='* '+a[i+3]+'\n'}
		  }
		} else if (o.type=='checkbox'){
		  if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
		} else if (o.type=='select-one'||o.type=='select-multiple'){
		  if(t==1&&o.selectedIndex/1==0){err=true}
		}else if (o.type=='textarea'){
		  if(v.length<a[i+1]){err=true}
		}
		if (err){s+='* '+a[i+3]+'\n'; err=false}
	  }
	  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
	  document.MM_returnValue = (s=='');
	}
	
	
/* - - - - - - - - - - - - - - - - - - P7 drop down Functions - - - - - - - - - - - - - - - - - - */

	function P7_JumpMenuGo(selName,restore){ //v1.1 Beta Version by Project Seven
	  var selObj = MM_findObj(selName); if (selObj) P7_JumpMenu(selObj,restore);
	}


	function P7_JumpMenu(selObj,restore){ //v1.4 by Project Seven
		var theFullString = selObj.options[selObj.selectedIndex].value;
		if (restore) selObj.selectedIndex=0;
		var theLength = theFullString.length;
		var endPos = theFullString.lastIndexOf("~");
		var theUrl, theTarget, theParent;
		if (endPos > 0) {theUrl = theFullString.substring(0,endPos);}
		else {theUrl = theFullString;}
		endPos++
		if (endPos < theLength) {theTarget = theFullString.substring(endPos,theLength)}
		else {theTarget = "window:Main";}
		if (theTarget == "window:New") {window.open(theUrl);}
		else if (theTarget == "window:Main") {eval("parent.location='"+theUrl+"'");}
		else {eval("parent.frames[\'"+theTarget+"\'].location='"+theUrl+"'");}
	}


	function P7_Snap() { //v2.67 by PVII
	 var g,x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
	 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
	 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
	 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
	 da="document.all['"+args[k]+"']";if(document.getElementById){
	 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
	 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
	 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
	 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
	 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
	 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
	  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
	  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
	  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
	 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
	  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
	  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
	 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
	  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
	 e.left=xx+pa;e.top=yy+pa;}}}
	}
	
	function P7_autoLayers() { //v1.5 by PVII
	 var g,b,k,f,u,k,j,args=P7_autoLayers.arguments,a=parseInt(args[0]);if(isNaN(a))a=0;
	 if(!document.p7setc){p7c=new Array();document.p7setc=true;for(u=0;u<10;u++){
	 p7c[u]=new Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){
	 b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++){
	 if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;hideDivSelects(a,g);b.visibility="visible";f=false;
	 for(j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
	 if(!f){p7c[a][p7c[a].length++]=args[k];}}}
	}
	
	function P7_hideDiv(evt) { //v1.3 by PVII
	 var b,relT,mT=false; 
	 if(document.layers){b=evt.target;if(b.p7aHide){
	  b.visibility="hidden";}else{routeEvent(evt);}
	 }else if(document.all&&!window.opera){b=event.srcElement;
	  while(b!=null){if(b.tagName=="DIV" && b.p7ahD){mT=true;break;}b=b.parentElement;}
	  if(!b.contains(event.toElement)){b.style.visibility="hidden";}
	 }else if(document.getElementById){b=evt.currentTarget;relT=evt.relatedTarget;
	  while(relT!=null){if(b==relT){mT=true;break;}
	  relT=relT.parentNode;}if(!mT){b.style.visibility="hidden";}}
	}
	
	function P7_autoHide() { //v1.3 by PVII
	 var i,g,args=P7_autoHide.arguments;
	 for(i=0;i<args.length;i++){if((g=MM_findObj(args[i]))!=null){
	  g.p7aHide=true;if(document.layers){
	  g.captureEvents(Event.MOUSEOUT);}g.onmouseout=P7_hideDiv;g.p7ahD=true;}}
	}

/* - - - - - - - - - - - - - - - - - - Custom Arbonne Functions - - - - - - - - - - - - - - - - - - */
	
function switchCountry(country, type) {
		var url;
		var newUrl = "";
		var subDomain = "";
		var newDomain = "";
		var ssl = "";
		var country;
		var ySubStrValue = 7;
		
		//get the current href location
		url = window.location;
		url = url.toString();
		
		// get script url
		x = url.indexOf('.com/');
		if (x>0){ newUrl = url.substr(x+5);}
		x = url.indexOf('.ca/'); 
		if (x>0){ newUrl = url.substr(x+4);}
			
		// ssl
		if (url.match('https')!=null){
			ssl="s";
			ySubStrValue = 8
			}
	
		if (url.match('192.168.2.')!=null){
			subDomain = "www."
		} else if(url.match('://arbonne')!=null) {
			subDomain = '';
		} else {
			// get current subdomain for devs,test,etc
			y = url.substr(ySubStrValue);
			y = y.split('.');
			subDomain = y[0]+'.';
		}
		if(type == "sub") {
			if(newUrl == '' || newUrl.indexOf('?') == 0)
				newUrl = 'sub/index.asp' + newUrl;
			else
				newUrl = 'sub/' + newUrl;
		}
			
		switch(country) {
			case 'us'	: path = 'http'+ssl+'://'+subDomain+'arbonne.com/'+newUrl; break;
			case 'ca'	: path = 'http'+ssl+'://'+subDomain+'arbonneinternational.ca/'+newUrl; break;
			default	: path = 'http'+ssl+'://'+subDomain+'arbonne.com/'+newUrl;
		}
		window.location = path;
	}		
	function generatePulldown() {
		
		var loc = new String(window.location);
		if(loc.indexOf('arbonneinternational.ca') > -1)
			arrayID = 1;
		else
			arrayID = 0;
		
		countryIds = Array('us', 'ca');
		names = Array('Arbonne United States', 'Arbonne Canada');
		
		for(var i=0; i<countryIds.length; i++) {
			if(i != arrayID)
				document.write("<p class=\"noSub\"><a href=\"javascript:switchCountry('" + countryIds[i] + "')\">" + names[i] + "</a></p><p class=\"noArbonne\"><a href=\"javascript:switchCountry('" + countryIds[i] + "','sub')\">" + names[i] + "</a></p>");
		}
	}
		
	function countryMain() {
		var loc = new String(window.location);
		if(loc.indexOf('arbonneinternational.ca') > -1)
			countryId = 'ca';
		else
			countryId = 'us';
			
		document.write('<img id="countryAnchor" name="countryAnchor" src="/images/common_graphics/topnav/topnav_arbonne' + countryId + '.gif" onMouseOver="P7_Snap(\'countryAnchor\',\'countryLayer\',0,16);P7_autoLayers(0,\'countryLayer\')" onMouseOut="closeMenu(event, 0)">');
		
	}
	
	
	function init(){
		// do nothing. 
		
		/* 
		
		This is a holder function executed at the end of a page. 
		Setting it empty here allows us to set a function in the body and have it execute instead of this empty function.
		
		*/
	}

	/* 
	 * Call on onmouseout events.  When passed the P7_storageID, it will close the stored views the cursor didn't
	 * land on after the mouseout until it finds the mouse on a stored view. Will also only close the layers
	 * specified in the order specified.
	 * Parameters: (ex, [P7_storageID1, P7_storageID2, ...])
	 */
	function closeMenu(e){
		var e,t,reltg,obj,i,j,k,args=closeMenu.arguments;
 		if(!e){e=window.event;}obj=(window.event)?e.srcElement:e.target;
		t=reltg=(e.toElement)?e.toElement:e.relatedTarget;while(t!=null&&t.tagName!='BODY'){
		if(t==obj){	return;}t=t.parentNode;}if(document.p7setc&&args.length>1){for(i=1;i<args.length;i++){
		k=parseInt(args[i]);for(j=0;j<p7c[k].length;j++){t=reltg;while(t!=null&&t.tagName!='BODY'){
		if(t.id==p7c[k][j]){return;}t=t.parentNode;}}P7_autoLayers(k);showDivSelects(k);}}MM_swapImgRestore();
	}
	
	/* 
	 * When called, it will set the display of html elements to either block or none depending on the arguments passed.
	 * Parameters: (HTML_ELEMENT_ID/NAME, show/hide)
	 * example ('tableId1', 'show', 'tableId2', 'hide')
	 */
	function setDisplay() {
		var obj,args=setDisplay.arguments;
		for(var i=0;i<args.length-1; i++) {
			if((obj = MM_findObj(args[i]))) {
				if(args[i+1] == 'hide')
					obj.style.display='none';
				else if(args[i+1] == 'show')
					obj.style.display='block';
			}
		}
	}

	/* 
	 * When called, it will randomly set the display of all but three html elements to none.
	 * Html elements that must be displayed together must have an id/name with '_num' attached.
	 * Parameters: (HTML_ELEMENT_ID/NAME)
	 * example ('tableId1', 'tableId2', 'tableId3', 'tableId4_1', 'tableId4_2')
	 */
	function showThree() {
		var num, i, j, k, r, first=false,firstOf='', count, over, tds, rem, node, args=showThree.arguments;
		tds = new Array();
		rem = new Array();
		for(i=0;i<args.length;i++)
			tds[i] = args[i];
		for(i=0;i<3;i++) {
			r = Math.floor(Math.random()*tds.length);
			if(tds[r].indexOf('_') > -1) {
				over = false;
				num = tds[r].split('_');
				count = 0;
				for (j=0;j<tds.length;j++) {
					if(tds[j].indexOf(num[0]) > -1) {
						count++;
					}
				}
				if(i+count <= 3) {
					i += count-1;
				}
				else {
					over = true;
					i--;
				}
				for (j=0;j<tds.length;j++) {
					if(tds[j].indexOf(num[0]) > -1) {
						if(over) {
							for(k=j;k<j+count;k++) {
								rem[rem.length] = tds[k];
							}
						}
						tds=rSplice(tds,j,count);
						break;
					}
				}
			}
			else {
				tds=rSplice(tds,r);
			}
		}
		for(j=0;j<tds.length;j++) {
			node=MM_findObj(tds[j]);
			node.parentNode.removeChild(node);
		}
		for(j=0;j<rem.length;j++) {
			node=MM_findObj(rem[j]);
			node.parentNode.removeChild(node);
		}
		for(j=0;j<args.length;j++) {
			if(!MM_findObj(args[j]))
				continue;

			if(MM_findObj(args[j]).style.display != 'none') {					
				if(args[j].indexOf('_') > -1) {
					num = args[j].split('_');
					if(firstOf == num[0])
						continue;
					firstOf = num[0];
				}
				if(!first) {
					first = true;
					continue;
				}
				MM_findObj(args[j]).className = 'NSBLeftBorder';
			}
		}
	}
	
	function rSplice(ar, index, count) {
		var nAr = new Array();
		if(isNaN(count)) count = 1;
		for(var i=0;i<ar.length;i++) { 
			if(i==index) {
				i+=count-1;
				continue;
			}
			nAr[nAr.length]=ar[i];
		}
		return nAr;
	}
	
	function addOnLoad(func) {
		var oldLoad = window.onload;
		window.onload = function()
			{
			if(oldLoad != null)
				oldLoad();
			func();
			}
	}
	function addOnResize(func) {
		var oldResize = window.onresize;
		window.onresize = function()
			{
			if(oldResize != null)
				oldResize();
			func();
			}
	}

	function icsnHighlight(e,s){
		e.className = 'icSectionNav_Hover' //'#ECF1EF'
		window.status = s;
	}
	function icsnUnhighlight(e){
		e.className = 'icSectionNav_Text';
		window.status = '';
	}
	function icssnHighlight(e,s){
		e.className = 'icSectionSubNav_Hover' //'#ECF1EF'
		window.status = s;
	}
	function icssnUnhighlight(e){
		e.className = 'icSectionSubNav_Text';
		window.status = '';
	}
	
	function limitTextLen(field,cntfield,maxlimit) {
		if (field.value.length > maxlimit){
			// if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
			// otherwise, update 'characters left' counter
		} else {
			x = maxlimit - field.value.length
			cntfield.value = x.toString() + ' characters available';
		}
	}
	function limitTextLenDiv(field,divName,maxlimit) {
		if (field.value.length > maxlimit){
			// if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
			// otherwise, update 'characters left' counter
		} else {
			x = maxlimit - field.value.length
			divWrite(divName, x.toString() + ' characters available');
		}
	}
	function divWrite(n,str){
		e=MM_findObj(n);
		e.innerHTML = str
	}


	
	/* 
	 * Get absolute left, top, right, and bottom of an html element
	 * example: getOffset(htmlObj)
	 * - Returns object r: r.l, r.t, r.r, r.b (left, right, top, and bottom; respectively)
	 */
	function getOffset(o){
		for(var r = {l: o.offsetLeft, t: o.offsetTop, r: o.offsetWidth, b: o.offsetHeight};o = o.offsetParent; r.l += o.offsetLeft, r.t += o.offsetTop);
		r.r += r.l;
		r.b += r.t;
		return r;
	}
	
	/* 
	 * Hides all select form elements in the document that the given object is overlapping
	 * Saves all hidden objects to an array of a given index that can be displayed again by calling showDivSelects(index)
	 * Parameters: (index Number, obj htmlObject)
	 * example: hideDivSelects(0, htmlObj)
	 */
	function hideDivSelects(index, obj) {
		var oPos = getOffset(obj);
		var fPos, i, j, k, found, intersect=false;
		if(!document.divSelects) {
			document.divSelects = Array();
			for(i=0;i<10;i++) {document.divSelects[i] = new Array();}
		}
			
		for(i=0; i < document.forms.length; i++) {
			for(j=0; j < document.forms[i].elements.length; j++) {
				formElement = document.forms[i].elements[j];
				if(formElement.type == 'select-one' || formElement.type == 'select-multiple') {
					fPos = getOffset(formElement);
					if(fPos.l && fPos.t && fPos.b && fPos.r) {
						if((oPos.l == fPos.l && oPos.t == fPos.t) || (oPos.l > fPos.l ? oPos.l <= fPos.r : fPos.l <= oPos.r) && (oPos.t > fPos.t ? oPos.t <= fPos.b : fPos.t <= oPos.b)) {
							found = false;
							intersect = true;
							formElement.style.visibility = 'hidden';
							for(k=0; k < document.divSelects[index].length; k++) {
								if(document.divSelects[index][k] == formElement)
									found = true;
							}
							if(!found)
								document.divSelects[index][document.divSelects[index].length] = formElement;
						}
					}
				}
			}
		}
		if(!intersect)
			showDivSelects(index);
	}
	
	/* 
	 * Displays all select form elements that were hidden by the call to hideDivSelects with the same index
	 * Parameters: (index Number)
	 * example: showDivSelects(0)
	 */
	function showDivSelects(index) {
		if(document.divSelects) {
			for(var i=0; i < document.divSelects[index].length; i++)
				document.divSelects[index][i].style.visibility = 'visible';
			document.divSelects[index].length = 0;
		}
	}
	
//-->

