<!--

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 JumpLink(link) {

	var win = window.open(link,"win");
    win.focus();
}

function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	var qs = '';
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			qs = pair[1];
		}
	} 
	return qs;
}

function Jump2QS() {
	var qs = getQueryVariable("go");
	var w = 764;
	if (qs.length != 0){
		var win = window.open(qs,"win", 'width=' + w);
		win.focus();
    }
}
			

function healthyBene()
{
	window.opener.location = 'Nicotine.aspx';
	window.close();
}

function learnMoreTwoSides()
{
	window.opener.location = 'Nicotine.aspx';
	window.close();
}

function updateState(index, hiddenId, divId)
{
	var hidden = document.getElementById(hiddenId);
	var vals = new String(hidden.value).split(",");

	//alert("start hidden.value:" + hidden.value);
	//alert("index:" + index);
	//alert("divId:" + divId);
	//alert(vals.length);
	//alert("vals[index]:" + vals[index]);

	if (vals[index] == 0)
	{
		vals[index] = 1;
	}
	else
	{
		vals[index] = 0;
	}
		
	hidden.value = vals.join(",");
	
	//alert("end hidden.value:" + hidden.value);
}

function BeastPusher()
{
	location.replace('Flash/TameTheBeast.aspx');
}

function getInfo()
{
	var url = location.href; 
	var loc = url.substring(url.lastIndexOf("\/")+1,url.lastIndexOf("\.")).toLowerCase(); 
	var so = new SWFObject("section_old.swf", "mymovie", "739", "416", "6", "#FF6314");   
                if(loc=="tamethebeast") 
                {so.write("flashcontent")} 
                else 
                {location.replace('Flash/TameTheBeast.aspx')}      
}

function getVids()
{
	
	var so = new SWFObject("section_new.swf", "SectionOld", "739", "416", "6", "#FF6314");
	so.addVariable("_moviename", "");
	so.write("flashcontent");
}
	


function getVidsIndex()
{
	location.replace('Flash/TameTheBeast.aspx?whichmovie=none');
}


//-->
