var nav_txt = '';
function whichPage(page_num)
{
 nav_txt = (page_num == 1)? '<span class="blk">Why Truestar Vitamins?</span> |'  :'<a  href="p_questions.asp?1" class="no_line1 wht">Why Truestar Vitamins?</a> |' ;
 nav_txt += (page_num == 2)? '<span class="blk">Why do I need them?</span> | ' : '<a  href="p_questions.asp?2" class="no_line1 wht">Why do I need them?</a> | ';
 nav_txt += (page_num == 3)? '<span class="blk">Compare our Products</span> | ' : '<a  href="p_questions.asp?3" class="no_line1 wht">Compare our Products</a> | ';
 nav_txt += '<a  href="/members/cm_pages14SL6P1.html" class="no_line1 wht">The How and Why of Vitamins</a>';
}

var the_num;
var the_url = window.location.toString();
the_num = the_url.slice(the_url.indexOf('?')+1);
whichPage(the_num);

function reveal(x)
{	alert(x);
    //para0 = document.getElementById('spGeneralInfo');
	switch(x)
	{
		case 1:
			link1.innerHTML = '<span id="l1">Why Truestar Vitamins?</span>';
			link2.innerHTML = '<span id="l2"><a  href="javascript:reveal(2);" class="faq_link">Why do I need them?</a></span>';
			link3.innerHTML = '<span id="l3"><a  href="javascript:reveal(3);" class="faq_link">Compare our Products</a></span>';
			
			para1.style.display = 'block';
			para2.style.display = 'none';
			para3.style.display = 'none';
			//para0.style.display = 'none';
		  break;    
		case 2:
		alert("1");
			link1.innerHTML = '<span id="l1"><a  href="javascript:reveal(1);" class="faq_link">Why Truestar Vitamins?</a></span>';
			alert("2");
			link2.innerHTML = '<span id="l2">Why do I need them?</span>';
			alert("3");
			link3.innerHTML = '<span id="l3"><a  href="javascript:reveal(3);" class="faq_link">Compare our Products</a></span>';
			alert("4");
			para1.style.display = 'none';
			alert("5");
			para2.style.display = 'block';
			alert("6");
			para3.style.display = 'none';
			//para0.style.display = 'none';
		  break;
		default:
			link1.innerHTML = '<span id="l1"><a  href="javascript:reveal(1);" class="faq_link">Why Truestar Vitamins?</a></span>';
			link2.innerHTML = '<span id="l2"><a  href="javascript:reveal(2);" class="faq_link">Why do I need them?</a></span>';
			link3.innerHTML = '<span id="l3">Compare our Products</span>';
			
			para1.style.display = 'none';
			para2.style.display = 'none';
			para3.style.display = 'block';
			//para0.style.display = 'none';
	}
	
}


function closeIt(id)
{
	var the_div = document.getElementById(id).style.display = "none";	
}


function openIt(id)
{
	var the_div = document.getElementById(id);
	the_div.style.display = "block";	
}


function switchBox(id_open,id_close)
{
	openIt(id_open);
	closeIt(id_close);
}

function dynOpenCloser(id_span,id_div,which)
{
//alert(id_span);
//alert(id_div);
	var the_span = document.getElementById(id_span);
	var the_div = document.getElementById(id_div);
	the_span.innerHTML = (which == 1)? '<a href="javascript:dynOpenCloser(\'' + id_span + '\',\'' + id_div + '\',0)"><img id="plus" src="images/pha/minus_off.jpg" border="0" alt="click to minimize these products" /></a>':'<a href="javascript:dynOpenCloser(\'' + id_span + '\',\'' + id_div + '\',1)"><img id="plus" src="images/pha/plus_off.jpg" border="0" alt="click to see more products" /></a>';
	//alert('innerHTML = ' + the_span.innerHTML);
	the_div.style.display = (which == 1)? 'block':'none'; //alert('display = ' + the_div.style.display);
}

function borderBottom(id,the_width,the_style,the_colour)
{
	var the_td = document.getElementById(id);
	the_td.style.borderBottomWidth = the_width;
	the_td.style.borderBottomStyle = the_style;
	the_td.style.borderBottomColor = the_colour;            
}

function tabProcessor(switching_id,which,id_td_noborder,id_td_border)
{
	//alert (id_td_noborder);
	//alert (id_td_border);
	(which == 1)? openIt(switching_id): closeIt(switching_id);

	borderBottom(id_td_noborder,'0px','solid','#adacac');
	borderBottom(id_td_border,'1px','solid','#adacac');
}


//creates objects refering to vitamin faq links
var link1, link2, link3, para1, para2, para3;
function starter()
{
	link1 = document.getElementById('l1');
	link2 = document.getElementById('l2');
	link3 = document.getElementById('l3');
	
	para1 = document.getElementById('case1');
	para2 = document.getElementById('case2');
	para3 = document.getElementById('case3');
	
	
}


function moreText(div_id,gif_id,anchor_name)
{
    var the_div = document.getElementById(div_id);
    var the_gif = document.getElementById(gif_id);
                                                    //alert('display_holder = ' + display_holder);
                                                    //alert('the_div.style.display0 = ' + the_div.style.display);
    if(the_div.style.display == '')
        {
            the_div.style.display = 'none';
        }
    
                                                    //alert('the_div.style.display1 = ' + the_div.style.display);
    the_div.style.display = (the_div.style.display == 'none')? 'block' : 'none';
                                                    //alert('the_div.style.display2 = ' + the_div.style.display);
    var imgString = new String(the_gif.src); //alert('imgString A = ' + imgString);  //get entire string of img url
    var imgs = imgString.indexOf('/minus'); //alert('imgs = ' + imgs);	//find the start of the base url
    the_gif.src = (imgs > 0)? 'images/testimonial_imgs/plus.gif' : 'images/testimonial_imgs/minus.gif';
    var img_plus = imgString.indexOf('/plus');
    //alert('img_plus = ' + img_plus); 
    if(img_plus == -1)
        {window.location.hash = anchor_name} //puts the page at the start of the currently clicked testimonial
}
function newWindow(the_url,win_name,the_width,the_height,bars)
{
	var the_window = null;
	var final_width = (the_width == 0)? (screen.width - 50) : the_width; //pass 0 as value for the_width to set width to available screen size
	var final_height = (the_height == 0)? (screen.height - 150) : the_height; //same for height
	var settings = 'width=' + final_width + ',height=' + final_height + ',scrollbars=' + bars + ',left=5,top=5,resizable,toolbar=no';
	the_window = window.open(the_url,win_name,settings);
}
// onclick="moreText('testimonial_0','plus0','crystal');"