var docRoot = getDocRoot(window.location.href);
//alert ("Line 14: [" + docRoot + "]");


var CurrentMap = "";

if (document.images) {
	menu_off = new Image;
	menu_off.src = docRoot + "images/menu_off.gif";
	
	register_on      = new Image;
	register_on.src  = docRoot + "images/nav/register_on.jpg";
	register_off     = new Image;
	register_off.src = docRoot + "images/nav/register_off.jpg";

	about_on      = new Image;
	about_on.src  = docRoot + "images/nav/about_on.gif";
	about_off     = new Image;
	about_off.src = docRoot + "images/nav/about_off.gif";
 
	booksellers1_on      = new Image;
	booksellers1_on.src  = docRoot + "images/nav/booksellers1_on.gif";
	booksellers1_off     = new Image;
	booksellers1_off.src = docRoot + "images/nav/booksellers1_off.gif";
	 
	publishers_on      = new Image;
	publishers_on.src  = docRoot + "images/nav/publishers_on.gif";
	publishers_off     = new Image;
	publishers_off.src = docRoot + "images/nav/publishers_off.gif";
 
	news_on      = new Image;
	news_on.src  = docRoot + "images/nav/news_on.gif";
	news_off     = new Image;
	news_off.src = docRoot + "images/nav/news_off.gif";
 
	affiliates_on      = new Image;
	affiliates_on.src  = docRoot + "images/nav/affiliates_on.gif";
	affiliates_off     = new Image;
	affiliates_off.src = docRoot + "images/nav/affiliates_off.gif";
	
	menua_off     = new Image;
	menua_off.src = docRoot + "images/about_menu_off.gif";
	menub_off     = new Image;
	menub_off.src = docRoot + "images/booksellersmenu_off.gif";
	menuc_off     = new Image;
	menuc_off.src = docRoot + "images/publishers_menu_off.gif";
	menud_off     = new Image;
	menud_off.src = docRoot + "images/news_menu_off.gif";
	menue_off     = new Image;
	menue_off.src = docRoot + "images/affiliates_menu_off.gif";
		
	transact_on     = new Image;
	transact_on.src = docRoot + "images/transact_on.gif";
	
	allines_off     = new Image;
	allines_off.src = docRoot + "images/allines_off.gif";
}


normal = new initializearray(10);
on = new initializearray(10);
map = new initializearray(5);

normal[0].src = docRoot + "images/allines_off.gif";
normal[1].src = docRoot + "images/allines_off.gif";
normal[2].src = docRoot + "images/allines_off.gif";
normal[3].src = docRoot + "images/allines_off.gif";
normal[4].src = docRoot + "images/allines_off.gif";
normal[5].src = docRoot + "images/allines_off.gif";
normal[6].src = docRoot + "images/allines_off.gif";
normal[7].src = docRoot + "images/allines_off.gif";
normal[8].src = docRoot + "images/allines_off.gif";
normal[9].src = docRoot + "images/allines_off.gif";

on[0].src = docRoot + "images/subpage_lines/aboutline_on.gif";
on[1].src = docRoot + "images/subpage_lines/bookline_on.gif";
on[2].src = docRoot + "images/subpage_lines/publishersline_on.gif";
on[3].src = docRoot + "images/subpage_lines/newsline_on.gif";
on[4].src = docRoot + "images/subpage_lines/affiliatesline_on.gif";

on[5].src = docRoot + "images/about_menu_off.gif";
on[6].src = docRoot + "images/booksellersmenu_off.gif";
on[7].src = docRoot + "images/publishers_menu_off.gif";
on[8].src = docRoot + "images/news_menu_off.gif";
on[9].src = docRoot + "images/affiliates_menu_off.gif";

	
function img_act(imgName,currMap)
{
	CurrentMap = currMap;
	if (document.images)
	{
		document[imgName].src = eval(imgName + "_on.src");
	} 
}

function imgmap_act(Line)
{
	if (document.images)
	{
		 if (CurrentMap == "booksellers") {			
			if (Line==1)
			document["menu"].src = eval("menu1" + "_on.src");			
			if (Line==2)
			document["menu"].src = eval("menu2" + "_on.src");			
			if (Line==3)
			document["menu"].src = eval("menu3" + "_on.src");			
			if (Line==4)
			document["menu"].src = eval("menu4" + "_on.src");			
			if (Line==5)
			document["menu"].src = eval("menu5" + "_on.src");			
			if (Line==6)
			document["menu"].src = eval("menu6" + "_on.src");
			}
		else {
		if (CurrentMap == "publishers") {			
			if (Line==1)
			document["menu"].src = eval("menu7" + "_on.src");			
			if (Line==2)
			document["menu"].src = eval("menu8" + "_on.src");			
			if (Line==3)
			document["menu"].src = eval("menu9" + "_on.src");			
			if (Line==4)
			document["menu"].src = eval("menu10" + "_on.src");			
			if (Line==5)
			document["menu"].src = eval("menu11" + "_on.src");			
			if (Line==6)
			document["menu"].src = eval("menu12" + "_on.src");		
		}
		else {
		if (CurrentMap == "news") {			
			if (Line==1)
			document["menu"].src = eval("menu13" + "_on.src");			
			if (Line==2)
			document["menu"].src = eval("menu14" + "_on.src");			
			if (Line==3)
			document["menu"].src = eval("menu15" + "_on.src");			
			if (Line==4)
			document["menu"].src = eval("menu16" + "_on.src");	
		}
		else {
		if (CurrentMap == "about") {			
			if (Line==1)
			document["menu"].src = eval("menu111" + "_on.src");			
			if (Line==2)
			document["menu"].src = eval("menu222" + "_on.src");			
			if (Line==3)
			document["menu"].src = eval("menu333" + "_on.src");			
			if (Line==4)
			document["menu"].src = eval("menu444" + "_on.src");			
			if (Line==5)
			document["menu"].src = eval("menu555" + "_on.src");			
			if (Line==6)
			document["menu"].src = eval("menu666" + "_on.src");		
		}
		else {
			if (CurrentMap == "affiliates") {			
				if (Line==1)
					document["menu"].src = eval("menu17" + "_on.src");			
				if (Line==2)
					document["menu"].src = eval("menu18" + "_on.src");	
			}
		}
		}
		}
		}
	} 
}


function imgmap_inact(){
	if (document.images){
		 if (CurrentMap == "about") 
				document["menu"].src = eval("menua" + "_off.src");
		 if (CurrentMap == "booksellers") 
				document["menu"].src = eval("menub" + "_off.src");
		 if (CurrentMap == "publishers") 
				document["menu"].src = eval("menuc" + "_off.src");
		 if (CurrentMap == "news") 
				document["menu"].src = eval("menud" + "_off.src");
		 if (CurrentMap == "affiliates") 
				document["menu"].src = eval("menue" + "_off.src");
	} 
}

function img_inact(imgName)
{
	CurrMap = "";
	if (document.images)
	{
		document[imgName].src = eval(imgName + "_off.src");
	}
}


        
function overmouse(Name){

   if (CurrentMap == "") {return;}

   var Num;
   if (CurrentMap == "about"){Num=0;} else  
   if (CurrentMap == "booksellers"){Num=1;} else
   if (CurrentMap == "publishers"){Num=2;} else
   if (CurrentMap == "news"){Num=3;} else
   if (CurrentMap == "affiliates"){Num=4;}

   document [Name].src = on[Num].src;
}
		
function overmouseb(Name,Num){

   if (CurrentMap == "") {return;}
   
   var Num;
   if (CurrentMap == "about"){Num=5;} else  
   if (CurrentMap == "booksellers"){Num=6;} else
   if (CurrentMap == "publishers"){Num=7;} else
   if (CurrentMap == "news"){Num=8;} else
   if (CurrentMap == "affiliates"){Num=9;}
   
   document [Name].src = on[Num].src;
}
		
function initializearray(arraysize)
{
   this.length = arraysize;
   for (var x = 0; x<=arraysize; x++)
   {
      this[x] = new Image();
   }
   return this;
}

function redirect(lineNum)
{
//alert ("Line 245: " + lineNum + "   " + CurrentMap);
   if (CurrentMap == "") {return;}  

   if (lineNum == 1) //FIRST POPUP MENU ITEM
   {
      if (CurrentMap == "about"){window.location.href       = docRoot + "about/service.html";}
      if (CurrentMap == "booksellers"){window.location.href = docRoot + "booksellers/book_features.html";}
      if (CurrentMap == "publishers"){window.location.href  = docRoot + "publishers/pub_features.html";}
      if (CurrentMap == "news"){window.location.href        = docRoot + "news/pressrelease.html";}
      if (CurrentMap == "affiliates"){window.location.href  = docRoot + "affiliates/participating.asp";}
   }
    else if (lineNum == 2) //SECOND POPUP MENU ITEM
   {
      if (CurrentMap == "about"){window.location.href       = docRoot + "affiliates/participating.asp";}   
      if (CurrentMap == "booksellers"){window.location.href = docRoot + "booksellers/value.html";}
      if (CurrentMap == "publishers"){window.location.href  = docRoot + "publishers/pub_value.html";}
      if (CurrentMap == "news"){window.location.href        = docRoot + "news/mediacoverage.html";}
      if (CurrentMap == "affiliates"){window.location.href  = "affiliates/participating.asp";}
   }

   else if (lineNum == 3) //THIRD POPUP MENU ITEM
   {
     if (CurrentMap == "about"){window.location.href        = docRoot + "about/strategic.html";}        
      if (CurrentMap == "booksellers"){window.location.href = docRoot + "booksellers/transact.html";}
      if (CurrentMap == "publishers"){window.location.href  = docRoot + "publishers/pub_small.html";}
      if (CurrentMap == "news"){window.location.href        = docRoot + "news/events.html";}
     
   }
   else if (lineNum == 4) //FOURTH POPUP MENU ITEM
   {
      if (CurrentMap == "about"){window.location.href       = docRoot + "about/employment.html";}          
      if (CurrentMap == "booksellers"){window.location.href = docRoot + "booksellers/testimonials.html";}
      if (CurrentMap == "publishers"){window.location.href  = docRoot + "publishers/pub_testimonials.html";}
      if (CurrentMap == "news"){window.location.href        = docRoot + "news/subscribe.html";} 
     
   }
   else if (lineNum == 5) //FIFTH POPUP MENU ITEM
   {
      if (CurrentMap == "about"){window.location.href       = docRoot + "about/contactus.html";}   
      if (CurrentMap == "booksellers"){window.location.href = docRoot + "booksellers/onlinehelp.html";}
      if (CurrentMap == "publishers"){window.location.href  = docRoot + "publishers/pub_join.html";}
      
      
   }
   else if (lineNum == 6) //SIXTH POPUP MENU ITEM
   {
      if (CurrentMap == "booksellers"){window.location.href = docRoot + "booksellers/onlinedemo.html";}
      if (CurrentMap == "publishers"){window.location.href  = docRoot + "publishers/pub_onlinedemo.html";}
      
   }
}     
function writeMenuMap() {
	document.write('<map NAME="menumap">');
	document.write('<area SHAPE="rect" COORDS="1,38,157,55" href="javascript:redirect(1);" onmouseover="overmouse(\'allines\');">');
	document.write('<area SHAPE="rect" COORDS="1,69,157,83" href="javascript:redirect(2);" onmouseover="overmouse(\'allines\');">');
	document.write('<area SHAPE="rect" COORDS="1,97,157,109" href="javascript:redirect(3);" onmouseover="overmouse(\'allines\');">');
	document.write('<area SHAPE="rect" COORDS="1,126,157,136" href="javascript:redirect(4);" onmouseover="overmouse(\'allines\');">');
	document.write('<area SHAPE="rect" COORDS="1,154,157,166" href="javascript:redirect(5);" onmouseover="overmouse(\'allines\');">');
	document.write('<area SHAPE="rect" COORDS="1,182,157,193" href="javascript:redirect(6);" onmouseover="overmouse(\'allines\');">');
	document.write('</map>');
}

function writeNavBar() {
	var x = '';
	// changed 11/18/2003 -- TPHa
	//x =  '<a TARGET="_top" href="http://register.pubeasy.com" onMouseOver="img_act(\'register\')" onMouseOut="img_inact(\'register\')">';
	x =  '<a TARGET="_top" href="http://register.pubeasy.com" onMouseOver="img_act(\'register\', \'\')" onMouseOut="img_inact(\'register\')">';
	x += '<img src="' + docRoot + 'online2/images/nav/register_off.jpg" name="register" border="0" vspace="0" hspace="0" width="97" height="25"></a>';
	
	x += '<a href="' + docRoot + 'index.html" TARGET="_top" onMouseOver="img_act(\'about\',\'about\'); overmouse(\'allines\'); overmouseb(\'menu\')" onMouseOut="img_inact(\'about\')">';
	x += '<img name="about" src="' + docRoot + 'online2/images/nav/about_off.gif" border="0" vspace="0" hspace="0" width="120" height="25"></a>';
	
	x += '<a href="' + docRoot + 'index.html" TARGET="_top" onMouseOver="img_act(\'booksellers1\',\'booksellers\'); overmouse(\'allines\'); overmouseb(\'menu\')" onMouseOut="img_inact(\'booksellers1\')">';
	x += '<img name="booksellers1" src="' + docRoot + 'online2/images/nav/booksellers1_off.gif" border="0" vspace="0" hspace="0" width="92" height="25"></a>';
	x += '<a href="' + docRoot + 'index.html" TARGET="_top" onMouseOver="img_act(\'publishers\',\'publishers\'); overmouse(\'allines\'); overmouseb(\'menu\')" onMouseOut="img_inact(\'publishers\')">';
	x += '<img name="publishers" src="' + docRoot + 'online2/images/nav/publishers_off.gif" border="0" vspace="0" hspace="0" width="85" height="25"></a>';
	x += '<a href="' + docRoot + 'index.html" TARGET="_top" onMouseOver="img_act(\'news\',\'news\'); overmouse(\'allines\'); overmouseb(\'menu\')" onMouseOut="img_inact(\'news\')">';
	x += '<img name="news" src="' + docRoot + 'online2/images/nav/news_off.gif" border="0" vspace="0" hspace="0" width="100" height="25"></a>';
	x += '<a href="' + docRoot + 'index.html" TARGET="_top" onMouseOver="img_act(\'affiliates\',\'affiliates\'); overmouse(\'allines\'); overmouseb(\'menu\')" onMouseOut="img_inact(\'affiliates\')">';
	x += '<img name="affiliates" src="' + docRoot + 'online2/images/nav/affiliates_off.gif" border="0" vspace="0" hspace="0" width="78" height="25"></a><br>';
	document.write(x);

	document.write('<img src="' + docRoot + 'images/allines_off.gif" name="allines" border="0" vspace="0" hspace="0" width="572" height="25">');

}