function toggleImg(imgId, newImg)
{
  if(document.images)
    document.images[imgId].src = eval(newImg + '.src')
}
if (document.images) {
  cnt_f2 = new Image(64 ,12); cnt_f2.src = "_images/img_contact_us_f2.gif";
  cnt_f1 = new Image(64 ,12); cnt_f1.src = "_images/img_contact_us.gif";
  faq_f2 = new Image(39 ,12); faq_f2.src = "_images/img_faq_f2.gif";
  faq_f1 = new Image(39 ,12); faq_f1.src = "_images/img_faq.gif";
  lnk_f2 = new Image(41 ,12); lnk_f2.src = "_images/img_links_f2.gif";
  lnk_f1 = new Image(41 ,12); lnk_f1.src = "_images/img_links.gif";
  hm_f2 = new Image(49 ,12); hm_f2.src = "_images/img_home_f2.gif";
  hm_f1 = new Image(49 ,12); hm_f1.src = "_images/img_home.gif";
  addevent_f2 = new Image(111 ,22); addevent_f2.src = "_images/btn_add_event_f2.gif";
  addevent_f1 = new Image(111 ,22); addevent_f1.src = "_images/btn_add_event.gif";
  addst_f2 = new Image(111 ,22); addst_f2.src = "_images/btn_add_stock_f2.gif";
  addst_f1 = new Image(111 ,22); addst_f1.src = "_images/btn_add_stock.gif";
  ipttr_f2 = new Image(111 ,22); ipttr_f2.src = "_images/btn_input_trans_f2.gif";
  ipttr_f1 = new Image(111 ,22); ipttr_f1.src = "_images/btn_input_trans.gif";
  rsettin_f2 = new Image(129 ,22); rsettin_f2.src = "_images/btn_reminder_sett_f2.gif";
  rsettin_f1 = new Image(129 ,22); rsettin_f1.src = "_images/btn_reminder_sett.gif";

  alr_f2 = new Image(15 ,15); alr_f2.src = "_images/ico_conf_alert_f2.gif";
  alr_f1 = new Image(15 ,15); alr_f1.src = "_images/ico_conf_alert.gif";
}


var vrs = parseInt(navigator.appVersion);
NS4 = (document.layers) ? true : false;
IE4 = ((document.all) && (vrs >= 4))?true:false;
NS6 = (navigator.appVersion.indexOf ("MSIE") < 0 && navigator.appVersion.indexOf('5.0') >= 0)
ver4 = (NS4 || IE4 || NS6) ? true : false;

function showmenu(id, stat)
{
	if(stat == 'show')
	{
		if(!NS4){ showIe(id) } else { showNs(id) }
	}
	else if(stat == 'hide')
	{
		if(!NS4){ hideIe() } else { hideNs() }
	}
}

function showNs(ids)
{
	//alert("NSlayer = "+ document.layers.length);
	hideNs();
	for (i=0; i < document.layers.length; i++)
  	{
	    whichEl = document.layers[i];
	    whichEl.pageX = 25;
	    if (ids == 1)
	    {
	    	if (whichEl.id.indexOf("pers") != -1) whichEl.visibility = "show";
	    }
	    else if (ids == 2)
	    {
		    if (whichEl.id.indexOf("corp") != -1) whichEl.visibility = "show";
	  }
  }
}

function hideNs()
{
  for (i=0; i<document.layers.length; i++)
  {
    whichEl = document.layers[i];
		if (whichEl.id.indexOf("pers") != -1) whichEl.visibility = "hide";
	   	if (whichEl.id.indexOf("corp") != -1) whichEl.visibility = "hide";
  }
}

function showIe(ids)
{
	hideIe();
	tmp = document.getElementsByTagName ?
	  document.getElementsByTagName("DIV") :
	  document.all.tags("DIV");
	for (i=0; i < tmp.length; i++)
	  {
		  	if(ids == 1)
		  	{
		    	if (tmp[i].id == "pers") tmp[i].style.visibility = "visible";
		    }
		    else if(ids == 2)
		    {
		      if (tmp[i].id == "corp") tmp[i].style.visibility = "visible";
		    }
	  }
}

function hideIe()
{
	tmp = document.getElementsByTagName ?
	  document.getElementsByTagName("DIV") :
	  document.all.tags("DIV");
	for (i=0; i < tmp.length; i++)
	{
   	if (tmp[i].id == "pers") tmp[i].style.visibility = "hidden";
  	if (tmp[i].id == "corp") tmp[i].style.visibility = "hidden";
  }
}

function expandDiv(){return;}

WITHWEEK = 1;
WITHOUTWEEK = 2;

function showDate(ipt)
{
	var weekdays = new Array(6);
	var months = new Array(11);

	var today = new Date();
	var month = today.getMonth();
	var date = today.getDate();
	var weekday = today.getDay();
	var year = today.getFullYear();
	if (year <= 99){
	 	year = year + 1900;
	}
	today = null;

	weekdays[0] = "Sunday";
	weekdays[1] = "Monday";
	weekdays[2] = "Tuesday";
	weekdays[3] = "Wednesday";
	weekdays[4] = "Thursday";
	weekdays[5] = "Friday";
	weekdays[6] = "Saturday";

	months[0] = "January";
	months[1] = "February";
	months[2] = "March";
	months[3] = "April";
	months[4] = "May";
	months[5] = "June";
	months[6] = "July";
	months[7] = "August";
	months[8] = "September";
	months[9] = "October";
	months[10] = "November";
	months[11] = "December";

	if(ipt == WITHWEEK)
	{
		return(weekdays[weekday] + ", " + months[month] + " " + date + ", " + year + "  ");
	}
	else if(ipt == WITHOUTWEEK)
	{
		return(months[month] + " " + date + ", " + year + "  ");
	}
}


function makeDate(dateObj, monthObj, yearObj, datenum){
	monthNames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
	if ((datenum == '') || (datenum == '0')) {
    dateidx = 0;
    monthidx = -1;
    yearidx = '';
  }
  else {
  	now = new Date(datenum);
  	dateidx = now.getDate();
  	monthidx = now.getMonth();
  	yearidx = now.getFullYear();
	}

	dateObj.options.length = 0;
	dateObj.options[0] = new Option("--", 0);
	for (i=1; i<=31; i++) {dateObj.options[i] = new Option(i, i);}
	dateObj.options[dateidx].selected = true;

	monthObj.options.length = 0;
	monthObj.options[0] = new Option("--", 0);
	for (i=1; i<=12; i++) {monthObj.options[i] = new Option(monthNames[i-1], i);}
	monthObj.options[monthidx+1].selected = true;

	yearObj.value = yearidx;
}

function hideAll()
{
	if(!NS4)
		hideIe();
	else
		hideNs();
}


function getPass()
{
  gp = window.open ('', '_PASS', 'menubar=no, scrolling=yes, width=300, height=300');
  gp.focus();
  gp.location.href='getpass.asp';
}

function showDemo()
{
  win = window.open ('', '_DEMO', 'menubar=no, scrollbars=yes, width=700, height=500');
  win.focus();
  win.location.href= '/demo/mystocks.asp'
}