﻿<!--

// show study layer
function ShowContent(d, e) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display != "block"){

	if (document.all) {
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	} else {
		tempX = e.pageX;
		tempY = e.pageY;
	}
	
	if(tempY < 320) {
		tempY = 282;
	} else {
		tempY -= 45;
	}
	  
	document.getElementById(d).style.display = "block";
	document.getElementById(d).style.top = tempY;
	document.getElementById(d).style.left = tempX;
	}
}
// wait .5 seconds and turn off study layer
function HideContent(d) {
if(d.length < 1) { return; }
setTimeout('document.getElementById("' + d + '").style.display = "none"',500);
}





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_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_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];}
   //MM_swapImage('imageName','','image/address',1);
}

function centerLayout(){
	var layoutWidth = 760;
	
	if (document.getElementById && navigator.appName == 'Netscape'){
		var bodyWidth = self.innerWidth;
		if(bodyWidth >= layoutWidth){
			document.getElementById('centerlayer').style.left = "50%";
			document.getElementById('centerlayer').style.marginLeft = "-380px";
		}else{
			document.getElementById('centerlayer').style.left = "0px";
			document.getElementById('centerlayer').style.marginLeft = "0px";
		}
		
	}else if (document.getElementById){
		var bodyWidth = document.body.offsetWidth; 
		
		if(bodyWidth >= layoutWidth - 10){
			document.getElementById('centerlayer').style.left = "50%";
			document.getElementById('centerlayer').style.marginLeft = "-380px";
		}else{
			document.getElementById('centerlayer').style.left = "0px";
			document.getElementById('centerlayer').style.marginLeft = "0px";
		}
		
	}else if (document.layers){
			document.layers['centerlayer'].left = 0;
			document.layers['centerlayer'].marginLeft = 0;
			
    }else if (document.all){
		var bodyWidth = self.innerWidth;
		if (bodyWidth >= layoutWidth){
			document.all.tags('div')['centerlayer'].style.left = "50%";
			document.all.tags('div')['centerlayer'].style.marginLeft = "-380px";
		}else{
			document.all.tags('div')['centerlayer'].style.left = "0px";
			document.all.tags('div')['centerlayer'].style.marginLeft = "0px";
		}
	}
}
   
function MM_showHideLayers() { //v3.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 showHideContent(id)
  {
    var elem = document.getElementById(id);
    var img = document.images['img' + id];
   	
   	var rExp = "";
   	var replace = "";
   	
    if (elem) 
    {
      if (elem.style.visibility == 'hidden') 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
		rExp = /up/gi;
        replace = "down";
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
        rExp = /down/gi;
        replace = "up";
      }
    }
    
     if (img)
	{
		imgSrc = new String(img.src);
		var newPath = imgSrc.replace(rExp,replace);
		img.src = newPath;
	}
  }
  
function showTips(id1,id2)
{
	var elem1 = document.getElementById(id1);
	var elem2 = document.getElementById(id2);
	
	 if (elem1 && elem2) 
    {
        elem1.style.display = 'none';
        elem1.style.visibility = 'hidden';
        elem2.style.display = '';
        elem2.style.visibility = 'visible';
    } 
} 

function MM_reloadPage()
{
}

function GetLink(list) {

	if (list.selectedIndex > 0) {
		var win = window.open("http://www.sbshopnow.com/templates/sbexit.asp?mr=" + (list.selectedIndex) + "&ct=LIST&sbid=" + list.options[list.selectedIndex].value,"win");
		win.focus();
	}
}

function JumpLink(link) {

	var win = window.open(link,"win");
    win.focus();
}

function popUp(strUrl,strName,strFeatures) {
	if(strUrl == ""){strUrl = "";}
	if(strName == ""){strName = "default";}
	if(strFeatures == ""){strFeatures = "";}
	
	newwindow = window.open(strUrl,strName,strFeatures);
}

//==============


function PanelToggle(pnl,pnllink,CSSname,isOff){
	if (isOff == "true"){
		document.getElementById(pnl).style.display = "none";
	}
	if (document.getElementById(pnl).style.display == "none"){
		document.getElementById(pnl).style.display = "block";
		document.getElementById(pnllink).className = CSSname + "-on";
	} else {
		document.getElementById(pnl).style.display = "none";
		document.getElementById(pnllink).className = CSSname;
	}
}

//===========

function checkQS(){
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) {
		var pos = parms[i].indexOf('=');
		if (pos > 0) {
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			if (key == "open"){
				if (document.getElementById("new" + val)){
					document.getElementById("new" + val).style.display = "block";
				}
				if (document.getElementById("lnk" + val)){
					document.getElementById("lnk" + val).className = "YWMwhatnew-on";
				}
			}
		}
	}
}

function ToggleSubPnls(pnlOn, pnlOff){
	document.getElementById(pnlOn).style.display = "none";
	document.getElementById(pnlOff).style.display = "block";
}

function getLearnMore(){
 window.location="products/"
}

function homeClickThrough(){
 window.location="products/"
}
function getPlusAntioxidants(){
 window.location="Products_antiox.aspx";
}
function getWeightManagement(){
 window.location="Products_wm.aspx";
}
function getPlusCalcium(){
 window.location="Products_pluscal.aspx";
}
function getTablets(){
 window.location="Products_tablets.aspx";
}
function getRedeemYourCode(){
 window.location="ffc_surveycontest.promo";
}
function getJoinFiberClub(){
 window.location="ffc_surveycontest.promo";
}


//-->