// JavaScript Document
var this_color = new Array();
this_color[0] = '#804692'; //attitude
this_color[1] = '#f2114c'; //exercise
this_color[2] = '#67b65d'; //nutrition
this_color[3] = '#007fbf'; //sleep
this_color[4] = '#ffa92e'; //vitamin
this_color[5] = '#a01734'; //corp colours
this_color[6] = 'none'; // no right nav
this_color[7] = '#c7c7c7'; //colour of line if no nav; light grey.

var gif_array = new Array(); // holds src string for rounded corner gif in the right nav table.
gif_array[0] = 'images/common/attitude_bottom.gif';
gif_array[1] = 'images/common/exercise_bottom.gif';
gif_array[2] = 'images/common/nutrition_bottom.gif';
gif_array[3] = 'images/common/sleep_bottom.gif';
gif_array[4] = 'images/common/vitamin_bottom.gif';
gif_array[5] = 'images/common/right_nav_bottom.gif';
gif_array[6] = 'images/common/spacer.gif';



function roller(id,source,which) //rollover function for images
{var the_url = (id.indexOf('btn') != -1)? 'images/common/buttons/' : 'images/common/';
 var _end = (which == 1)? '_on' : '_off';
 var elem = document.getElementById(id);
 elem.src = the_url + source + _end + '.gif';
}

function getDate2()
{	var mydate=new Date();
	var year=mydate.getYear();

	if (year<2000)
		year=1900+year;
	
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();

	if (daym<10)
		daym=""+daym;

	var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
    return ""+montharray[month]+" "+daym+", "+year+"";
}

var the_window = null;
function newWindow(the_url,win_name,the_width,the_height,bars)
{var final_width = (the_width == 0)? (screen.width - 20) : the_width; //pass 0 as value for the_width to set width to available screen size
 var final_height = (the_height == 0)? (screen.height - 100) : the_height; //same for height
 var settings = 'width=' + final_width + ',height=' + final_height + ',scrollbars=' + bars + ',left=5,top=5,resizable';
 the_window = window.open(the_url,win_name,settings);
}

function makeChecked(id)// allows anchored text to change checked status of checkbox
{var the_input = document.getElementById(id);
 the_input.checked = (the_input.checked == true)? false:true;
}

var been_checked = 0;
var the_message = new Array();
the_message[0] = 'You must answer whether or not you are taking medication to continue: scroll to the top of the page and click one of the buttons.';
the_message[1] = 'You must answer whether or not you have read the page before you can continue. Click the checkbox when you have done so.';
//the_message[] = '';
function checkIt()
{been_checked = (been_checked == 0)? 1:0;}

function checkForm(the_form,which_msg)
{
 if(been_checked == 0)
	{alert(the_message[which_msg]);
	 return false;
	}
}

/*
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
win = window.open(mypage,myname,settings)
}
//<a href="#" onclick="NewWindow(this.href,'name','200','300','yes');return false">Website Abstraction</a>
*/