//-------------  to print frame mainwindow only ------------------------
function myprint() {
window.parent.mainwindow.focus();
window.print();
}

//-------------  Redirect to index.htm    ------------------------
if(self.parent.frames.length==0){
  self.parent.location="index.htm";
  }
//-----------------------------------------------------

//-------------- managing tabs  -----------------------

  var curTab = 0;
  var curHL = 0;
  var tabDefs = new Array();
// Tab About Us //
  tabDefs[0]=[['Mission','Technology','Applications','Strategy','Management'],
	['aboutus_1.htm',
	'aboutus_2.htm',
	'aboutus_3.htm',
	'aboutus_4.htm',
	'aboutus_5.htm'],
	['','','','','']];


// Tab ALZHEIMER’S STUDY //
  tabDefs[1]=[['Overview','FAQ\’s','Brochure','Contacts','Sign Up'],
	['study_1.htm',
	'study_2.htm',
	'study_3_files/Alzheimers_Study_Brochure.pdf',
	'study_4.htm',
	'http://clinicaltrials.gov/ct2/show/NCT00582127?term=neuronetrix&rank=1'],
	['','','','','']];


// Tab Resources //
  tabDefs[2]=[['Advocacy','Research','Centers','Longterm Care','Misc'],
	['resources_1.htm',
	'resources_2.htm',
	'resources_3.htm',
	'resources_4.htm',
	'resources_5.htm'],
	['','','','','']];
// Tab News // 
  tabDefs[3]=[['New Releases','TV and Radio','Market Research','Alzheimers Press','Alzheimer Search'],
	['news_1.htm',
	'news_2.htm',
	'news_3.htm',
	'http://news.search.yahoo.com/search/news/?p=alzheimer&ei=UTF-8&fr=FP-tab-news-t&cop=mss&tab=5',
	'http://www.google.com/search?hl=en&q=alzheimer&btnG=Google+Search'],
	['','','','','']];
// Tab Investors //
  tabDefs[4]=[['Disclaimer','Exec Overview','Biz Plan','Presentation','Private Offering'],
	['investors_1.aspx',
	'investors_files/Neuronetrix Executive Summary.pdf',
	'investors_files/Neuronetrix Business Plan.pdf',
	'files_presentations/Neuronetrix_Investor/Neuronetrix-Investor-imp.html',
	'investors_5.htm'],
	['','','','','']];

// Tab Cognicion User //
  tabDefs[5]=[['Download'],
	['CognisionUser.aspx'],
	['']];
// Login page //
  tabDefs[6]=[['User Login', 'User Registration'],
	['Login_user.aspx', 'Register_user.aspx'],
	['', '']];

// TAB RESOURCES //
  tabDefs[7]=[['Resources'],
	['resources_1.htm'],
	['']];

// TAB EMPLOYMENT//
  tabDefs[8]=[['Employment'],
	['employment_1.htm'],
	['']];

// TAB CONTACT US //
  tabDefs[9]=[['Contact Us'],
	['contactus_page.htm'],
	['']];


//-------------------------------------
  function Init()
  {
    SelectTabGroup(0);
  }

//-------------------------------------


function SubmitClick(ref1,ref2){
       parent.Frametop.SelectTabGroup(ref1);
	if(ref1<0)
    parent.mainwindow.location.href = ref2;
    }
//-------------------------------------


function SubmitClick3(ref1,ref2){
       parent.Frametop.SelectTabGroup(ref1);
	if(ref1<0)
       this.location.href = ref2;
    }
//-------------------------------------


// graphics/bg_tab_blue.gif - image for tab
// graphics/bg_tab_blue.gif - image for tab background (imitation of tabs line)
//
  function CreateTabGroup(idx)
  {
    var i=0;
	var txt;
    with (document)
	{
	  write('<table height="39" width="*" border="0" background="./graphics/bg_tab_blue.gif" cellspacing="0" cellpadding="0" valign="bottom" ID="tg'+idx+'" style="display:none;">');
	  write('<tr allign="left">');
	  write('<td valign="bottom" align="left" class="td_tab" width="15">&nbsp;</td>');
      for (i=0;i<tabDefs[idx][0].length;i++)
	  {
	    txt=(tabDefs[idx][2][i].length>0)?tabDefs[idx][2][i]:'Go to highlighted page...';
        write('<td class="td_tab" width="130" valign="top" align="left" nowrap background="./graphics/tab.gif"><a HIDEFOCUS class="tabs" href="'+tabDefs[idx][1][i]+'" target="mainwindow" onClick="SelectTab(this)" onMouseOver="HiliteTab(this);window.status=\''+txt+'\';return true;" onMouseOut="HiliteTab(false);window.status=\'\';return true;">&nbsp;'+tabDefs[idx][0][i]+'&nbsp;</a></td>');
	  }
	  write('<td width="90%" class="td_tab">&nbsp;</td>');
	  write('</tr>');
	  write('</table>');
      write(String.fromCharCode(10));
	}
  }
//-------------------------------------
  function SelectTabGroup(idx)
  {
    // Hide all tab groups
    for (var i=0;i<tabDefs.length;i++)
      document.getElementById('tg'+i).style.display='none';

    if (idx==-1) return;
    if (idx>=tabDefs.length) return;

    // Show current tab group
    document.getElementById('tg'+idx).style.display='block';
    // Select First tab
    SelectTab(document.getElementById('tg'+idx).getElementsByTagName('A')[0]);
  }
//-------------------------------------
  function SelectTab(obj)
  {
	if (curTab) with (curTab) {filters[0].grayscale=false;if (filters[1].enabled) filters[1].enabled=false;}
    if (obj.filters==undefined) return;
    if (obj.filters.length>0)
	{
      // Hilite...

      obj.filters[0].grayscale=false;

	  with (obj.filters[1])
	  {
	    clear();
	    addAmbient(210,222,244,100); // blue
	    enabled=true;
	  }
	}
	curTab=obj;
	parent.mainwindow.location.href=obj.href;
  }
//-------------------------------------
  function SelectTabGroup1(idx)
  {
    // Hide all tab groups
    for (var i=0;i<tabDefs.length;i++)
      document.getElementById('tg'+i).style.display='none';

    if (idx==-1) return;
    if (idx>=tabDefs.length) return;

    // Show current tab group
    document.getElementById('tg'+idx).style.display='block';
    // Select First tab
    SelectTab1(document.getElementById('tg'+idx).getElementsByTagName('A')[0]);
  }
//-------------------------------------
  function SelectTabGroup2(idx,idxTab)
  {
    // Hide all tab groups
    for (var i=0;i<tabDefs.length;i++)
      document.getElementById('tg'+i).style.display='none';

    if (idx==-1) return;
    if (idx>=tabDefs.length) return;

    // Show current tab group
    document.getElementById('tg'+idx).style.display='block';
    // Select First tab
    SelectTab1(document.getElementById('tg'+idx).getElementsByTagName('A')[idxTab]);
  }
//-------------------------------------  
  function SelectTab1(obj)
  {
	if (curTab) with (curTab) {filters[0].grayscale=false;if (filters[1].enabled) filters[1].enabled=false;}
    if (obj.filters==undefined) return;
    if (obj.filters.length>0)
	{
      // Hilite...

      obj.filters[0].grayscale=false;

	  with (obj.filters[1])
	  {
	    clear();
	    addAmbient(210,222,244,100); // blue
	    enabled=true;
	  }
	}
	curTab=obj;
	// parent.mainwindow.location.href=obj.href;
  }
//-------------------------------------
  function HiliteTab(obj)
  {
    if (obj!=curTab)
	{
      if (curHL) if (curHL!=curTab) with (curHL) {filters[0].grayscale=false;}
    if (obj.filters==undefined) return;
	  if (obj)
	  {
        if (obj.filters.length>0)
	    {
          // Hilite...
          obj.filters[0].grayscale=true;
	    }
	    curHL=obj;
	  }
	}
  }

//-------------------------------------
function offSelectRecursive(obj)
{
	for (var i=0; i<obj.children.length; i++)
	{
		if (obj.children[i].className=="selected")
		{
			obj.children[i].className="plain"
		}
		else
		{
			offSelectRecursive(obj.children[i])
		}
	}
}

//-------------------------------------
function deselect()
{
	offSelectRecursive(document.body)
}

//-------------------  for left menu ------------------
function offSelectRecursive_l(obj)
{
	for (var i=0; i<obj.children.length; i++)
	{
		if (obj.children[i].className=="selected_l")
		{
			obj.children[i].className="plain"
		}
		else
		{
			offSelectRecursive_l(obj.children[i])
		}
	}
}
//-------------------- for left menu -----------------
function deselect_l()
{
	offSelectRecursive_l(document.body)
}
//-------------------- for left menu -----------------
function deselect_l_news()
{
	offSelectRecursive_l(parent.Frameleft.document.body)
}

//--------------- creates a window (printable size) to show docs from News tab -------------------

function NewWindow(url3)
	{window.open(url3,"","height=600, width=600,resizable=yes, scrollbars, status=no,location=no,toolbar=no,directories=no,menubar=no");
}
//-------------- transform image  -------------------

function transform(pic,pic1,pic2){		 

   myimg.filters("revealtrans").apply()		/* settle first image */

   if (document.all.myimg.src.indexOf(pic)!= -1)	/* second image */
       document.all.myimg.src = pic2
   else 
       document.all.myimg.src = pic1 

   myimg.filters("revealtrans").play();		// transform image
   SubmitClick1(3,"news_1.htm");

}



