/* js file for truestar clinic */
var is_visible = 0;
var id_array = new Array();
id_array[0] = ['17','18'];
id_array[1] = ['9','10','11','12','13','14','15','16'];
//id_array[] = '';


function changeVis(vis)
{
 var current_visibility = (vis == 1)? 'visible':'hidden';
 for(i=9; i<17; i++)
 	{
	 if (document.getElementById('a' + i) != undefined)
		{
		 document.getElementById('a' + i).style.visibility = current_visibility;
		}
	}
 
}

function inVis(vis,id)
{
 var current_display = (vis == 1)? 'block':'none';
 document.getElementById(id).style.display = current_display; 
}
//alert('id array 0.length = ' + id_array[0][1]);
function changeAllVis(vis,array_index)
{
 var current_display = (vis == 1)? 'inline':'none';
 var array_length = id_array[array_index].length
 for(i=0; i<array_length; i++)
 	{document.getElementById('a' + id_array[array_index][i]).style.display = current_display;
	 document.getElementById('b' + id_array[array_index][i]).style.display = current_display;
	}
 //var the_elem =document.getElementById(id) 
	// {the_elem.style.visibility = current_visibility;}
}

var txt_a = '<strong>Reach Your Weight Loss Goals with Energy and Ease!</strong><ul><li>Free your  body of toxins and cravings</li><li>Improve you skin’s appearance</li><li>Increase your energy</li></ul>'; // cleanse
var txt_b = '<strong>Start on the Road to Health.</strong><ul><li>Balance your blood sugars</li><li>Achieve better health and hormonal  harmony</li><li>Improve your concentration </li><li>Lose fat and transform your body</li><li>Prevent in overeating and aid in appetite control </li></ul>';//restore
var txt_c = '<strong>Set the Foundation for a Healthier Tomorrow.</strong><ul><li>Increase your metabolism</li><li>Improve your metabolic rate</li><li>Achieve peak energy levels</li><li>Achieve your target weight </li><li class="li_1">Improve your libido</li></ul>';//revive

//Variables used in script for popup
var posX, posY;
function browserCheckSmall()
{
 this.ns4 = (document.layers)?  1:0; //alert('ns4 = ' + this.ns4);
 this.ns6 = (document.getElementById && document.getComputedStyle)? 1:0; //alert('ns6 = ' + this.ns6);
 this.ns7 = (document.getElementById && (navigator.userAgent.indexOf('Netscape/7.01') != -1))? 1:0; //alert('ns7 = ' + this.ns7);
 this.firefox = (document.getElementById && (navigator.userAgent.indexOf('Firefox') != -1))? 1:0; //alert('firefox = ' + this.firefox);
 this.ie6 = (document.getElementById && document.all)? 1:0; //alert('ie6 = ' + this.ie6);
 this.ie4 = (document.all && !document.getElementById)? 1:0; //alert('ie4 = ' + this.ie4);
 this.ns = (this.ns4 || this.ns6 || this.ns7 || this.firefox)? 1:0; //alert('ns = ' + this.ns);
 this.ie = (this.ie4 || this.ie6)? 1:0; //alert('ie = ' + this.ie);
}
var is = new browserCheckSmall();
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
//Collection of functions to get mouse position and place the images

function changeText(title_text,body_text)
{
 //var container_obj_outer = document.getElementById('popup');
 var title_obj = document.getElementById('caption_txt');
 var text_obj = document.getElementById('body_txt');
 title_obj.innerHTML = title_text;
 text_obj.innerHTML = body_text;
}
function findMouseCoords(e)
{
 /* if(is.ns4 || is.ns6 || is.ns7 || is.firefox)
	{
	window.open('autoship.html','autoship','height=140,width=215');
	}
	else
 { */
  posX = getMouseXPos(e);
  posY = getMouseYPos(e);
	var container_obj = document.getElementById('popup');
	
  if(is.ns4 || is.ns6 || is.ns7 || is.firefox) // forgot to put in || is.ns7
 	{container_obj.style.left = (posX + "px");
	 container_obj.style.top = (posY + "px");
	}
 	else
	{
	 container_obj.style.left = posX;
	 container_obj.style.top = posY;
	}

  container_obj.style.visibility = (is.ns4 || is.ns6 || is.ns7 || is.firefox)? 'show':'visible';
// }
}
// Get the horizontal position of the mouse
function getMouseXPos(e)
{
  if (is.ns) 
  { var goleft = e.pageX; alert('goleft = ' + goleft);
    return parseInt(e.pageX+10)
  }
  else
  {
    return (parseInt(event.clientX+10) + ietruebody().scrollLeft)//parseInt(document.body.scrollLeft))
  }
}
// Get the vartical position of the mouse
function getMouseYPos(e)
{
  if (is.ns4 || is.ns6 || is.ns7 || is.firefox)
  {
    return parseInt(e.pageY)
  } 
  else 
  {
    return (event.clientY + ietruebody().scrollTop)//(parseInt(event.clientY) + parseInt(document.body.scrollTop))
  }
}
function unPop(id)
{document.getElementById(id).style.visibility = 'hidden';}
//