// 3D-infoSpace navigation functions
// Copyright(C) Sergiy Beloy
// Contact email: creator@3D-infospace.com
// Visit www.3D-infoSpace.com for more details

var i,l;
var i_max=100;

// Content of control.html:
var Panel = "<IMG SRC='../browser/images/control.gif' USEMAP='#control' width='80' height='80' border='0'>"
+"<MAP NAME='control'>"
+"<AREA SHAPE='CIRCLE' COORDS='41,41,8' HREF='javascript:void reset()' OnMouseOver='status=\"O |<<  Go to Starting instance and level... \";return true;' OnMouseOut='status=\"\";'>"
+"<AREA SHAPE='POLY' COORDS='1,0,78,0,41,41' HREF='javascript:void up()' OnMouseOver='status=\"Up...\";return true;' OnMouseOut='status=\"\";' >"
+"<AREA SHAPE='POLY' COORDS='80,1,80,79,41,41' HREF='javascript: void forward()' OnMouseOver='status=\"FORWARD...\";return true;' OnMouseOut='status=\"\";'>"
+"<AREA SHAPE='POLY' COORDS='78,80,2,80,41,41' HREF='javascript:void down()'  OnMouseOver='status=\"Down...\";return true;' OnMouseOut='status=\"\";'>"
+"<AREA SHAPE='POLY' COORDS='0,79,0,1,41,41' HREF='javascript:void  back()' OnMouseOver='status=\"BACK...\";return true;' OnMouseOut='status=\"\";'>"
+"</MAP>"

+"<FORM>"
+"<INPUT TYPE='TEXT' NAME='dspl-L' SIZE='3' value=''> "
+"<font face='\"Times New Roman\"', Times, serif' color='red' size='1pt'> Level</font><br>"
+"<INPUT TYPE='TEXT' NAME='dspl-I' SIZE='3' value=''> "
+"<font face='\"Times New Roman\"', Times, serif' color='red' size='1pt'> Page</font><br>"
+" </FORM>"

+"<P><table WIDTH=80 Align=left cellSpacing=0 cellPadding=5 border=0><tbody><tr><td ID='p' bgColor=#99CCFF>"
+"<B><FONT face='Arial' size=2><BUTTON STYLE=\"WIDTH:'100%';HEIGHT:'100%';align:center;\" "
+"onClick='P()'>Pick!</BUTTON></FONT></B>"
/// +"</td></tr></tbody></table>"
/*
+"<tr><td height=40>&nbsp;</td></tr><tr><td>"
+"<font STYLE='COLOR:#999999;FONT-SIZE:12px;FONT-FAMILY:Verdana,Arial,Helvetica'>Mini-Web:</font><br>"
*/
+"</td></tr></tbody></table>";
/*
+"<IFRAME SRC='"
	// [SET]:
	+"mini-web-banner.html"
	+"' WIDTH=80 HEIGHT=150"
	+ " ALT='BANNER for *My Topic* Mini-Web -- reserved property of the future text spot owner!' "
+"MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=0 SCROLLING=no Align=left vAlign=bottom></IFRAME>";
*/

var blank = true;	// not highlighted

// Show current position in Control's display:
function Display() { 
  document.forms[0].elements['dspl-L'].value=l; 
  document.forms[0].elements['dspl-I'].value=i;
}

// Draw control.html:
function Draw() {
  document.write(Panel);
  i=I;
  l=L;
  Display();
  // Support for highlights
  try
	{
    // for IE, Opera:
	document.body.onload=ReadPicks;			 
 	document.body.onunload=SavePicks;
    if (!document.body.attributes.onload)	// for Mozilla
		{
		document.body.setAttribute("onload", "ReadPicks();");
		document.body.setAttribute("onunload", "SavePicks();");
		}
	}
  catch (objException)
	{ }
}

// Show main content:
function Show() {
  if (l==2)
	{ parent.frames['Content'].document.location.href="../"+i+"/index.html";}
  else	// l=1
	{ parent.frames['Content'].document.location.href="../"+i+"/info.html";}
   parent.frames['Banner'].document.location.href="../"+i+"/banner.html";
}

// **************************
// Main navigation functions:

function forward ()  {
   if (i==i_max)  
           { i=0; }
   i++;          
   Display();
   Show();
   ShowPick();
} 

function back () { 
   if (i==1) 
		{ i=(i_max+1); }
   i--; 
   Display();
   Show();
   ShowPick();
} 

function up () { 
   if (l < 2) { l++; }       
   else	{ 
		parent.document.location.href="http://3d-infospace.com/index1.php"; 
		// !!! 
		// parent.document.location.href="../index.html"; 
		}	
   Display();
   Show();
   ShowPick();
} 

function down ()   { 
   if (l>1)  { l--; }

   Display();
   Show();
   ShowPick();
}

// Reset, go to default entry screen
function reset () {  
   // Set default values:
   i = I;
   l = L;
	
   Display();
   Show();
   ShowPick();
}
